package com.dawn.usermanage.bean;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * The persistent class for the tw_sinainfo database table.
 * 
 */
@Entity
@Table(name = "tw_sinainfo")
public class TwSinainfo implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    private String sinaId;
    // 微博昵称
    private String screenName;
    // 性别,m--男，f--女,n--未知
    private String gender;
    // 粉丝数
    private int fansNum;
    // 关注数
    private int followNum;
    // 本站关注数
    private int localFollowNum;
    // 微博数
    private int statusesCount;
    // 描述
    private String description;
    // 头像
    private String profileImageUrl;
    private String profileBackgroundImageUrl;
    private String profileBackgroundTile;

    private String location;
    // 用户个人主页
    private String url;
    // 创建时间
    private Date createdAt;
    // 加V标示，是否微博认证用户
    private boolean verified;
    //标签
    private String tags;

    public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	// bi-directional many-to-one association to UserinfoBean
    @OneToOne(mappedBy = "twSinainfo")
    private UserBean tuUserinfos;

    public String getSinaId() {
        return this.sinaId;
    }

    public void setSinaId(String sinaId) {
        this.sinaId = sinaId;
    }

    public int getFansNum() {
        return this.fansNum;
    }

    public void setFansNum(int fansNum) {
        this.fansNum = fansNum;
    }

    public int getFollowNum() {
        return this.followNum;
    }

    public void setFollowNum(int followNum) {
        this.followNum = followNum;
    }

    public int getLocalFollowNum() {
        return this.localFollowNum;
    }

    public void setLocalFollowNum(int localFollowNum) {
        this.localFollowNum = localFollowNum;
    }

    public String getScreenName() {
        return this.screenName;
    }

    public void setScreenName(String screenName) {
        this.screenName = screenName;
    }

    public UserBean getTuUserinfos() {
        return this.tuUserinfos;
    }

    public void setTuUserinfos(UserBean tuUserinfos) {
        this.tuUserinfos = tuUserinfos;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getStatusesCount() {
        return statusesCount;
    }

    public void setStatusesCount(int statusesCount) {
        this.statusesCount = statusesCount;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getProfileImageUrl() {
        return profileImageUrl;
    }

    public void setProfileImageUrl(String profileImageUrl) {
        this.profileImageUrl = profileImageUrl;
    }

    public String getProfileBackgroundImageUrl() {
        return profileBackgroundImageUrl;
    }

    public void setProfileBackgroundImageUrl(String profileBackgroundImageUrl) {
        this.profileBackgroundImageUrl = profileBackgroundImageUrl;
    }

    public String getProfileBackgroundTile() {
        return profileBackgroundTile;
    }

    public void setProfileBackgroundTile(String profileBackgroundTile) {
        this.profileBackgroundTile = profileBackgroundTile;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public boolean isVerified() {
        return verified;
    }

    public void setVerified(boolean verified) {
        this.verified = verified;
    }

    public String getSex() {
        String sex = this.getGender();
        if ("m".equals(sex))
            return "男";
        else if ("f".equals(sex))
            return "女";
        return "未知";
    }

    public String getProfileImg() {
        String imgUrl = this.getProfileImageUrl();
        return imgUrl.replace("\\50\\", "\\180\\");
    }
}